import mongoengine as db

from app.db import BaseDocument


class ReportPush(BaseDocument):

    meta = {
        'collection': 'push_report',
        'strict': False
    }

    uid = db.ObjectIdField(required=True)
    username = db.StringField(required=True)
    is_free_user = db.BooleanField(default=False)
    start_time = db.StringField()  # 报告数据开始时间
    end_time = db.StringField()  # 报告数据结束时间
    enable_task_status = db.StringField(choices=("part", "all", "null"))  # 监测项开启状态
    enable_task_map = db.DictField()  # 监测项开启具体详情
    completed_task_type = db.DictField()  # 有完成任务的监测项
    receiver_data = db.DictField()  # 报告接受人信息
    kb_data = db.DictField()  # 漏洞知识库数据
    push_time = db.DateTimeField()  # 报告生成时间
    asset_status_data = db.DictField()  # 资产状态模块数据
    asset_risk_data = db.DictField()  # 资产风险模块数据
    web_sec_task_data = db.DictField()  # web 安全监测模块数据
    web_available_task_data = db.DictField()  # 可用性监测模块数据
    overview_data = db.DictField()  # 报告头概览数据
